package com.xuecheng.base.exception;

/**
 * @Author:王亚栋
 * @Date: 2023/7/9 下午12:27
 * @Version:1.0
 * TODO 自定义异常处理
 */
public class XCPlusException extends RuntimeException {

    private String errMessage;

    public XCPlusException(String message) {

        super(message);

        this.errMessage = message;
    }

    public static void cast(String message){

        throw new XCPlusException(message);
    }

    public static void cast(CommonError error){

        throw new XCPlusException(error.getErrMessage());
    }
}
